Image processing apparatus and image processing method

ABSTRACT

An image processing apparatus includes a detection unit to detect that an object moving in an image displayed within a rectangular display area has passed through a detection line segment. A setting unit sets, based on a user operation, the detection line segment within the rectangular display area. A display control unit displays a setting area being set along at least one side of the rectangular display area and a remaining area of the rectangular display area other than the setting area, so that they can be distinguished. The setting area is an area in which false determination of the detection by the detection unit may occur due to at least one of a size of the object and a speed of the object.

CLAIM OF PRIORITY

This is a continuation application of copending U.S. patent applicationSer. No. 13/454,441, filed Apr. 24, 2012, which is incorporated byreference herein in its entirety.

This application also claims the benefit of Japanese Patent ApplicationNo. 2011-114110, filed May 20, 2011, which is hereby incorporated byreference herein in its entirety.

BACKGROUND OF THE INVENTION

Field of the Invention

The present invention relates to an image processing apparatus and animage processing method for observation or monitoring using pictures.

Description of the Related Art

When detecting the passage of an object or a human body through aspecific portion in a screen by using a picture obtained from asurveillance camera, or the like, a conventional technique tracks theobject or human body detected from the picture within the screen anddetects the passage through the specific portion.

There is known a conventional technique of detecting an object frommotion vectors, estimating a search position in the next frame, andtracking the object by template matching (for example, Japanese PatentLaid-Open No. 2002-373332). There is also known a technique as aconventional example, which performs face tracking based on motioninformation detected from the correlation between a current frame and apast frame (for example, Japanese Patent Laid-Open No. 2010-50934). Itis possible to determine the passage of an object through a specificportion based on this tracking result. In general, when performingpassage detection, the passage of an object is determined by detectingthat a tracking line, which is the locus of object tracking, intersectswith a set determination line segment or determination region frame.

When, however, a passage detection line is set near the upper and lowerends or the left and right ends within an imaging screen, even an objectthat has passed over the passage detection line cannot sometimes bedetected. Assume the use of a scheme of tracking a tracking position inan object to be detected on an object barycenter basis, when detectingan object moving from outside to inside a screen. In this case, in thefirst image that depicts an object that has entered the screen, thebarycentric position has already been located inside the set detectionline and has passed it. This is because, when the object appears in theimaging screen, the barycentric position has already been locatedinwardly from the screen by several pixels. For this reason, in thiscase, the tracking line of the barycentric position does not intersectwith the passage detection determination line, and, hence, the passageof the object cannot be detected. This phenomenon is especiallynoticeable for a fast object.

The following is another example of the inability to detect passage.When an object is located at the position of a screen end, it is notpossible to determine the moving direction of the object in the imagecaptured for the first time. This makes it impossible sometimes todetect the passage of the object.

On the other hand, it is possible to set a detection method ofdetermining the passage of an object to be detected when part of theobject comes into contact with a detection line, instead of thebarycenter of the object. This can avoid the above detection omission,but may cause a false detection. For example, when, in fact, an objecthas just passed nearby a detection line, although part of the object hastouched the line, false detection occurs, because the object has notactually moved across the detection line. For this reason, the passageof an object is generally detected by tracking the barycenter of theobject or the midpoint of a diagonal line of the object and using theintersection between it and a detection line.

When settings are made to inhibit the detection of any object having aspecific size or less upon filtering the size of each object to bedetected, part of the object falls outside of the screen at a screenend. For this reason, the apparent size of the object to be detecteddecreases on the screen, and the object is excluded from detection atthe time of filtering. This may lead to detection omission.

SUMMARY OF THE INVENTION

The present invention has been made in consideration of the aboveproblems, and provides a technique for preventing false detection near ascreen end when detecting the passage of an object or a human bodythrough a specific portion within a screen by using the picturesobtained from a surveillance camera, or the like.

According to a first aspect, the present invention provides an imageprocessing apparatus comprising a detection unit that detects that anobject moving within a display screen has passed through an objectdetection line segment set in the display screen, and a setting unitthat sets a region, where the detection is inhibited, in a frame of thedisplay screen, wherein the detection unit detects that the object haspassed through the object detection line segment set in a region otherthan the region set by the setting unit.

According to a second aspect, the present invention provides an imageprocessing method comprising a detection step of detecting that anobject moving within a display screen has passed through an objectdetection line segment set in the display screen, and a setting step ofsetting a region, where the detection is inhibited, in a frame of thedisplay screen, wherein, in the detection step, it is detected that theobject has passed through the object detection line segment set in aregion other than a region set in the setting step.

According to a third aspect, the present invention provides anon-transitory computer-readable storage medium recording a program forcausing a computer to execute a detection step of detecting that anobject moving within a display screen has passed through an objectdetection line segment set in the display screen, and a setting step ofsetting a region, where the detection is inhibited, in a frame of thedisplay screen, wherein, in the detection step, it is detected that theobject has passed through the object detection line segment set in aregion other than a region set in the setting step.

Further features of the present invention will become apparent from thefollowing description of exemplary embodiments with reference to theattached drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram showing an example of the functionalarrangement of an image processing apparatus;

FIG. 2 is a view showing an example of the arrangement of informationmanaged by a locus management unit 104;

FIG. 3A is a view showing the first arrangement example of parametersdefining an object detection region;

FIG. 3B is a view showing the second arrangement example of parametersdefining an object detection region;

FIG. 3C is a view showing the third arrangement example of parametersdefining an object detection region;

FIG. 4 is a view for explaining the processing performed by a locusinformation determination unit 106;

FIG. 5 is a view for explaining the determination of the passage of anobject;

FIG. 6 is a view for explaining an application window;

FIG. 7 is a flowchart showing setting processing for an object detectionregion and an inhibition region;

FIG. 8 is a view for explaining setting processing for an inhibitionregion;

FIG. 9 is a view showing a display example of an object detectionregion; and

FIG. 10 is a view for explaining setting processing for an inhibitionregion.

DESCRIPTION OF THE EMBODIMENTS

An embodiment of the present invention will be described below withreference to the accompanying drawings. The embodiment described belowis an example of a concrete execution of the present invention, and oneof the specific embodiments of the arrangements described in the scopeof claims.

This embodiment is directed to an image processing apparatus thatdisplays a moving image depicting a moving object in a display screen todetect that the object moving in the display screen has passed throughan object detection region set in the display screen.

An example of the functional arrangement of the image processingapparatus according to this embodiment will be described first withreference to the block diagram of FIG. 1. An image processing apparatus100 can be a general PC (Personal Computer), an image processing circuitmounted in a camera capable of capturing moving images, or another typeof device, as long as it can implement the function of the imageprocessing apparatus described above.

A display device 190 formed by a CRT, liquid crystal screen, or thelike, is connected to the image processing apparatus 100. The imageprocessing apparatus 100 displays its processing result on the displaydevice 190 in the form of images, characters, and the like. Thefollowing is a case in which a moving image is displayed on the displayscreen of the display device 190.

An image acquisition unit 101 sequentially acquires the images of framesconstituting a moving image depicting one or more objects that move inand out of the display screen or move across a plurality of frameswithin the display screen. The image acquisition unit 101 sequentiallyoutputs the acquired images of the respective frames to an objectdetection unit 102. The image acquisition unit 101 may acquire such amoving image from an imaging device capable of capturing moving imagesor a device holding such moving images in advance. That is, the sourceof moving images is not specifically limited.

The object detection unit 102 detects an object depicted in the image ofa frame received from the image acquisition unit 101 by using atechnique such as a background differencing technique. Obviously, theobject detection method to be used is not limited to any specificmethod. Upon detecting an object from the image of a given frame, theobject detection unit 102 generates various kinds of information (to bedescribed later) associated with the detection.

When the object detection unit 102 detects the same object as thatdetected from the image of a frame immediately preceding a frame ofinterest, an object tracking unit 103 associates the objects in therespective frames with each other. Assume that the object tracking unit103 assigns object ID=A to the object that the object detection unit 102has detected from the image of the frame immediately preceding the frameof interest. When the object detection unit 102 also detects the sameobject from the frame of interest, the object tracking unit 103 alsoassigns object ID=A to the object. In this manner, when identicalobjects are detected throughout a plurality of frames, the same ID isassigned to each object. Note that a new object ID is assigned to anobject newly detected in a frame of interest.

A locus management unit 104 manages information for each object that isobtained by the object detection unit 102 and the object tracking unit103. FIG. 2 shows an example of the arrangement of information managedby the locus management unit 104.

In management information 201 managed by the locus management unit 104,information (object information) 202 is managed for each object. Inother words, in the management information 201, the object information202 is managed for each object ID. In the object information 202 for oneobject, information 203 is managed for each frame (Timestamp) in whichthe object has been detected. The information 203 includes a detectedcoordinate position (Position), information (Boundingbox) that defines acircumscribed rectangle enclosing the region of the detected object, andthe size of the object (size). Obviously, pieces of information that canbe included in object information are not limited to them, and mayinclude any kind of information as long as it provides the ability toimplement the processing to be described below. A locus informationdetermination unit 106 properly uses each information managed by thelocus management unit 104.

A determination parameter setting unit 105 acquires or sets parametersfor the determination of the passage of an object in the image of eachframe through an object detection region, that is, parameters thatdefine the object detection region. The determination parameter settingunit 105 then sets the acquired or set parameters in the locusinformation determination unit 106.

FIG. 3A shows an example of the arrangement of parameters acquired orset by the determination parameter setting unit 105. The parametersshown in FIG. 3A define a line segment (Line) connecting coordinates(10, 10) and coordinates (20, 30) on the display screen of the displaydevice 190 as an object detection region. These parameters define thatwhen an object having a size (Size) of 100 to 250 has passed through(cross) this object detection region (line segment), the object isregarded as a detection target.

The locus information determination unit 106 performs passagedetermination processing for an object with respect to an objectdetection region based on the parameters set by the determinationparameter setting unit 105 and the information managed by the locusmanagement unit 104. The processing performed by the locus informationdetermination unit 106 when the parameters shown in FIG. 3A are set willbe described with reference to FIG. 4.

The locus information determination unit 106 determines whether a motionvector 404 from a circumscribed rectangle 402 of an object in a frameimmediately preceding a frame of interest to a circumscribed rectangle403 of an object in the frame of interest has intersected with a linesegment 401 defined by parameters. To determine whether the motionvector has intersected with the line segment is to determine whether theobject has passed through the line segment 401.

Determination of the passage of an object through the above line segmentset on an end portion of the display screen of the display device 190will be described below with reference to FIG. 5.

A screen 501 is the display screen of the display device 190 that isdisplaying the image of a frame at time t1. A line segment 502 set onthe right end of the screen 501 is a line segment defined as an objectdetection region by parameters. Although not displayed on the screen501, a vehicle (a circumscribed rectangle 503 in FIG. 5) that willappear in the subsequent frame on the screen is approaching from theright side of the screen 501.

A screen 504 is a display screen of the display device 190 that displaysthe image of a frame (a frame at time t2) succeeding the frame at timet1. Part of the vehicle is depicted in the screen 504. A circumscribedrectangle 505 is a circumscribed rectangle of the vehicle detected bythe object detection unit 102 from the screen 504. A position 506 is thecenter position of the circumscribed rectangle 505. Assume that thevehicle has appeared for the first time in this frame within the displayscreen.

A screen 507 is a display screen of the display device 190 that displaysthe image of a frame (a frame at time t3) succeeding the frame at timet2. All of the vehicle is depicted in the screen 507. A circumscribedrectangle 508 is a circumscribed rectangle of the vehicle detected bythe object detection unit 102 from the screen 507. A position 509 is thecenter position of the circumscribed rectangle 508.

When performing passage determination for the screen at time t3, thelocus information determination unit 106 determines whether a linesegment connecting the position 506 and the position 509 intersects withthe line segment 502. In the case shown in FIG. 5, although the objectas the vehicle has passed through the line segment 502 in fact, the linesegment connecting the position 506 and the position 509 does notintersect with the line segment 502. For this reason, in this case, thelocus information determination unit 106 determines that the object asthe vehicle has not passed through the line segment 502. Thisdetermination is, therefore, falsely determined as a result.

Providing an object detection region on an end portion of a screen inthis manner will increase the possibility of such false determination.In contrast, in order to prevent such false determination, thisembodiment sets a region near an end portion (frame) of a screen as aninhibition region of “detection whether an object moving in the screenhas passed through the object detection region set in the screen”.

This inhibition region will be described with reference to FIG. 6.Reference numeral 601 denotes an application window that is displayed onthe screen of the display device 190 to set an inhibition region, and602, a region for displaying the image of each frame acquired by theimage acquisition unit 101. It is not indispensable to display the imageof each frame in the region 602 in the following processing, and theimage (still image) of a given frame or no image may be displayed in theregion 602.

In this embodiment, a region that inhibits the above passagedetermination is set in the region 602. Referring to FIG. 6, aninhibition region is set as indicated by reference numeral 603. Theinhibition region 603 is a region outside of a region 605 enclosed bythe following four borders in the region 602:

-   -   a border spaced apart from the top border of the region 602 by a        set distance in an inward direction of the region 602,    -   a border spaced apart from the bottom border of the region 602        by a set distance in an inward direction of the region 602,    -   a border spaced apart from the left border of the region 602 by        a set distance in an inward direction of the region 602, and    -   a border spaced apart from the right border of the region 602 by        a set distance in an inward direction of the region 602.

In other words, this embodiment is configured to perform the abovepassage determination for only the region 605 enclosed by these fourborders. Referring to FIG. 6, reference numeral 604 denotes the distance(set distance) between the bottom border of the region 605 and thebottom border of the region 602. Since the region 602 is a reducedregion of the display screen of the display device 190, the inhibitionregion 603 is a reduced region of an inhibition region set on the actualdisplay screen. On the actual display screen of the display device 190,a region outside of the region enclosed by the following four borders isan inhibition region for passage determination:

-   -   a border spaced apart from the top border of the display screen        by a set distance in an inward direction of the display screen,    -   a border spaced apart from the bottom border of the display        screen by a set distance in an inward direction of the display        screen,    -   a border spaced apart from the left border of the display screen        by a set distance in an inward direction of the display screen,        and    -   a border spaced apart from the right border of the display        screen by a set distance in an inward direction of the display        screen.

The user can set the inhibition region 603 described above in the region602, as well as an object detection region by using the determinationparameter setting unit 105. In this case, the determination parametersetting unit 105 is implemented by an input device, such as a keyboardor mouse. Obviously, the inhibition region 603 may be determined inadvance. Referring to FIG. 6, the user sequentially sets points 606,607, and 608 to set, as an object detection region, a series of linesegments constituted by a line segment connecting the points 606 and 607and a line segment connecting the points 607 and 608. As describedabove, however, the inhibition region 603 inhibits passagedetermination, and hence, the determination parameter setting unit 105inhibits an object detection region from being included in theinhibition region 603. In the case shown in FIG. 6, since the point 608is included in the inhibition region 603, when the user tries to set thepoint 608, the determination parameter setting unit 105 inhibits thesetting operation. Various kinds of methods of inhibiting settingoperation are conceivable. If, for example, this apparatus uses a methodof making the user operate the determination parameter setting unit 105to move the cursor and to set a point at the current position of thecursor, the apparatus may inhibit the cursor from moving to theinhibition region 603. Alternatively, the apparatus may allow the cursorto move to the inhibition region 603, but may reject a point settingoperation, or may forcibly move a point set in the inhibition region 603to the outside of the inhibition region 603.

In this manner, when setting an object detection region in thisembodiment, the apparatus controls the setting processing so as toprevent the object detection region from overlapping an inhibitionregion. As a consequence, the apparatus performs passage determinationin regions other than the region that inhibits passage determination,thereby preventing the above false determination.

The determination result obtained by the locus information determinationunit 106 may be output to the outside via an outside output unit 107. Ifthe outside output unit 107 is a display device formed by a CRT or aliquid crystal screen, the outside output unit 107 may be used insteadof the display device 190.

Setting processing for an object detection region and an inhibitionregion will be described with reference to FIG. 7 showing a flowchartfor this processing.

In step S701, the locus information determination unit 106 determineswhether to continue the following processing, that is, to terminate thisprocessing. The apparatus terminates the processing if a condition forterminating the processing is satisfied, for example, an instruction toterminate the processing is input. If the following processing is to becontinued, the process advances to step S702.

In step S702, the locus information determination unit 106 readsparameters like those shown in FIG. 3A, which have been acquired or setby the determination parameter setting unit 105, from the determinationparameter setting unit 105. If the determination parameter setting unit105 has not acquired/set such parameters, the process advances to stepS704, while skipping steps S702 and S703.

In step S703, the locus information determination unit 106 calculates aregion that permits detection of an object and a region that inhibitsdetection of an object from the parameters read in step S702. Processingperformed in this step will be described with reference to FIGS. 3B and8.

Assume that the parameters read in step S702 are those having thearrangement shown in FIG. 3B. According to the parameters shown in FIG.3B, a line segment (Line) connecting coordinates (950, 250) andcoordinates (950, 600) on the display screen of the display device 190is defined as an object detection region. In addition, the parametersdefine that when an object having a size (Size) of 300 to 400 has passedthrough this object detection region (line segment), the object isregarded as a detection target.

Upon acquiring such parameters from the determination parameter settingunit 105, the locus information determination unit 106 may set a setdistance 802 to half of the maximum size of the object to be detected,that is, 200. Assume that the coordinate positions of the upper left andlower right corners of a display screen 801 of the display device 190are respectively (0, 0) and (1200, 1000). In this case, the locusinformation determination unit 106 sets the inside of a rectangularregion 803 with the coordinate positions of the upper left and lowerright corners being (200, 200) and (1000, 800), respectively, as aregion that provides the ability to set an object detection region, anda region outside of the rectangular region 803 as the above inhibitionregion.

Assume that the locus information determination unit 106 has readparameters having the arrangement shown in FIG. 3C from thedetermination parameter setting unit 105 in step S702. The parametersshown in FIG. 3C define a line segment (Line) connecting coordinates(1190, 250) and coordinates (1190, 600) on the display screen of thedisplay device 190 as an object detection region. These parameters alsodefine that when an object having a size (Size) of 150 to 200 has passedthrough (cross) this object detection region (line segment), the objectis regarded as a detection target.

Upon acquiring such parameters from the determination parameter settingunit 105, the locus information determination unit 106 may set a setdistance 1001 to half of the maximum size of the object to be detected,that is, 100, as shown in FIG. 10. In this case, the locus informationdetermination unit 106 sets the inside of a rectangular region 1002 withthe coordinate positions of the upper left and lower right corners being(100, 100) and (1100, 900), respectively, as a region that provides theability to set an object detection region, and a region outside of therectangular region 1002 as the above inhibition region. In this case,part of the object detection region is included in the inhibitionregion. The apparatus may re-set either or both of an object detectionregion and an inhibition region so as to avoid the object detectionregion from being included in the inhibition region. If, for example, anobject detection region is to be re-set, “Coordinate” of the parametersshown in FIG. 3C may be corrected to (1100, 250) and (1100, 600).

According to the above description, a set distance is obtained inaccordance with the size of an object to be detected. However, anothermethod may be used as a method of obtaining a set distance. For example,it is possible to obtain a set distance in accordance with the movingspeed of this object in the screen. In this case, it is possible toobtain the moving distance of the object between a current frame and apast frame in the screen as a moving speed and to increase a setdistance with an increase in obtained moving speed.

Referring back to FIG. 7, in step S704, as shown in FIG. 6, theapparatus displays an application window showing a region that inhibitsdetection of an object and an object detection region on the displayscreen of the display device 190. A method of displaying each region isnot limited to this.

When the process advances to step S704, while skipping steps S702 andS703, the apparatus does not display an object detection region or aninhibition region, and the user newly sets these regions by operatingthe determination parameter setting unit 105 in step S704.

According to the above description, the width and height of an object tobe detected are not designated. However, a width and a height may beadded as setting items. In this case, when calculating set distances instep S703, it is possible to set a set distance at the top and bottomborders in accordance with a height, and a set distance at the left andright borders in accordance with a width. When, for example, setting ahuman body as an object to be detected, since the human body is anobject that is longer in the widthwise direction than in the heightdirection, the set distance at the top and bottom borders is longer thanthat at the left and right borders. This also applies to a case in whicha set distance is obtained in accordance with the moving speed of theobject. That is, when parameters are set on the assumption that themoving speed of the same object varies in the horizontal and verticaldirections depending on the installation conditions for a camera, it ispossible to set a set distance at the top and bottom borders inaccordance with the moving speed in the vertical direction and a setdistance at the left and right borders in accordance with the movingspeed in the horizontal direction.

In step S705, the locus information determination unit 106 determineswhether an inhibition region or an object detection region has been set(re-set). This determination is to determine whether the user has set(re-set) an inhibition region or an object detection region by, forexample, changing a set distance, editing or creating an objectdetection region in the application window by using the determinationparameter setting unit 105. If the apparatus determines, as a result ofthis determination, that the user has not set (re-set) any region, theprocess advances to step S707. If the apparatus determines that the userhas set (re-set) a region, the process advances to step S706.

In step S706, the locus information determination unit 106 reflects thechange made by setting (re-setting) in the inhibition region and/or theobject detection region. More specifically, the locus informationdetermination unit 106 reflects information after a change in the objectdetection region in the information managed by the locus management unit104, and stores information defining the set (re-set) inhibition region.Assume that the object detection region is included in a region thatinhibits the detection of any object at this time. The coping techniquesdescribed above are applied to such a case.

For example, in step S706, as shown in FIG. 9, if the user designates aregion 1201 as an object detection region, the apparatus may display notonly the region 1201, but also, a region 1202 that is set by moving theregion 1201, so as to prevent it from being included in an inhibitionregion.

If a situation that will terminate this processing occurs (a conditionfor the termination of the processing is satisfied or an instruction toterminate the processing is input), the process returns to step S702through step S707. If no such situation has occurred, the apparatusterminates the processing through step S707. Obviously, if the processreturns to step S702 through steps S706 and S707, the change made instep S706 is reflected in the corresponding region.

As has been described above, according to this embodiment, when adetection region is set near the upper and lower ends or the left andright ends within the imaging screen by using the picture obtained froma surveillance camera, or the like, it is possible to prevent falsedetection near an end of the screen.

Obviously, although the above description has exemplified thedetermination of passage of an object through a region as an example ofobject detection, the present invention can be applied to otherdetection contents.

Other Embodiments

Aspects of the present invention can also be realized by a computer of asystem or an apparatus (or devices such as a CPU or an MPU) that readsout and executes a program recorded on a memory device to perform thefunctions of the above-described embodiment(s), and by a method, thesteps of which are performed by a computer of a system or an apparatusby, for example, reading out and executing a program recorded on amemory device to perform the functions of the above-describedembodiment(s). For this purpose, the program is provided to thecomputer, for example, via a network or from a recording medium ofvarious types serving as the memory device (for example, acomputer-readable medium).

While the present invention has been described with reference toexemplary embodiments, it is to be understood that the invention is notlimited to the disclosed exemplary embodiments. The scope of thefollowing claims is to be accorded the broadest interpretation so as toencompass all such modifications and equivalent structures andfunctions.

1-8. (canceled)
 9. An image processing apparatus comprising: a detectionunit configured to detect that an object moving in an image displayedwithin a rectangular display area has passed through a detection linesegment; a setting unit configured to set, based on a user operation,the detection line segment within the rectangular display area; and adisplay control unit configured to display a setting area being setalong at least one side of the rectangular display area and a remainingarea of the rectangular display area other than the setting area, sothat they can be distinguished, wherein the setting area is an area inwhich false determination of the detection by the detection unit mayoccur due to at least one of a size of the object and a speed of theobject.
 10. The apparatus according to claim 9, further comprising acontrol unit configured to control operation so that at least a portionof the detection line segment is not included within the setting area.11. The apparatus according to claim 10, wherein the control unit isconfigured to move the detection line segment so that at least a portionof the detection line segment is not included within the setting area.12. The apparatus according to claim 10, wherein the control unit isconfigured to re-set the setting area so that at least a portion of thedetection line segment is not included within the setting area.
 13. Theapparatus according to claim 10, wherein the control unit is configuredto limit the user operation so that at least a portion of the detectionline segment is not included within the setting area.
 14. The apparatusaccording to claim 9, wherein the setting area is an area where thedetection is inhibited, and is an outside of an area enclosed by aborder spaced apart from a top border of the rectangular display area bya set distance in an inward direction of the rectangular display area, aborder spaced apart from a bottom border of the rectangular display areaby a set distance in an inward direction of the rectangular displayarea, a border spaced apart from a left border of the rectangulardisplay area by a set distance in an inward direction of the rectangulardisplay area, and a border spaced apart from a right border of therectangular display area by a set distance in an inward direction of therectangular display area.
 15. An image processing method comprising:detecting that an object moving in an image displayed within arectangular display area has passed through a detection line segment;setting, based on a user operation, the detection line segment withinthe rectangular display area; and displaying a setting area being setalong at least one side of the rectangular display area and a remainingarea of the rectangular display area other than the setting area, sothat they can be distinguished, wherein the setting area is an area inwhich false determination of the detection in the detecting unit mayoccur due to at least one of a size of the object and a speed of theobject.
 16. The method according to claim 15, further comprisingcontrolling operation so that at least a portion of the detection linesegment is not included within the setting area.
 17. The methodaccording to claim 16, wherein, in the controlling, the detection linesegment is moved so that at least a portion of the detection linesegment is not included within the setting area.
 18. The methodaccording to claim 16, wherein, in the controlling, the setting area isre-set so that at least a portion of the detection line segment is notincluded within the setting area.
 19. The method according to claim 16,wherein, in the controlling, the user operation is limited so that atleast a portion of the detection line segment is not included within thesetting area.
 20. The method according to claim 15, wherein the settingarea is an area where the detection is inhibited, and is an outside ofan area enclosed by a border spaced apart from a top border of therectangular display area by a set distance in an inward direction of therectangular display area, a border spaced apart from a bottom border ofthe rectangular display area by a set distance in an inward direction ofthe rectangular display area, a border spaced apart from a left borderof the rectangular display area by a set distance in an inward directionof the rectangular display area, and a border spaced apart from a rightborder of the rectangular display area by a set distance in an inwarddirection of the rectangular display area.
 21. A non-transitorycomputer-readable storage medium storing a computer-program for causinga computer to function as: a detection unit configured to detect that anobject moving in an image displayed within a rectangular display areahas passed through a detection line segment; a setting unit configuredto set, based on a user operation, the detection line segment within therectangular display area; and a display control unit configured todisplay a setting area being set along at least one side of therectangular display area and a remaining area of the rectangular displayarea other than the setting area so that they can be distinguished,wherein the setting area is an area in which false determination of thedetection by the detection unit may occur due to at least one of a sizeof the object and a speed of the object.
 22. The medium according toclaim 21, further comprising a control unit configured to controloperation so that at least a portion of the detection line segment isnot included within the setting area.
 23. The medium according to claim22, wherein the control unit is configured to move the detection linesegment so that at least a portion of the detection line segment is notincluded within the setting area.
 24. The medium according to claim 22,wherein the control unit is configured to re-set the setting area sothat at least a portion of the detection line segment is not includedwithin the setting area.
 25. The medium according to claim 22, whereinthe control unit is configured to limit the user operation so that atleast a portion of the detection line segment is not included within thesetting area.
 26. The medium according to claim 21, wherein the settingarea is an area where the detection is inhibited, and is an outside ofan area enclosed by a border spaced apart from a top border of therectangular display area by a set distance in an inward direction of therectangular display area, a border spaced apart from a bottom border ofthe rectangular display area by a set distance in an inward direction ofthe rectangular display area, a border spaced apart from a left borderof the rectangular display area by a set distance in an inward directionof the rectangular display area, and a border spaced apart from a rightborder of the rectangular display area by a set distance in an inwarddirection of the rectangular display area.